<admintpl file="headerEx" />
<title>{:L('ADMIN_AD_INDEX')}</title>

<!--responsive table-->
<link href="__PUBLIC__/TciocEx/css/table-responsive.css" rel="stylesheet" />
</head>

<!-- Placed js at the end of the document so the pages load faster -->
<body class="sticky-header">
<section>
	<!-- main content start-->
	<div class="full-content" >
		<!--body wrapper start-->
		<div class="wrapper  js-check-wrap">
			<div class="row">
				<div class="col-sm-12">
					<section class="panel">
						<header class="panel-heading custom-tab turquoise-tab">
							<ul class="nav nav-tabs">
								<li class="active"><a href="{:U('ad/index')}"><i class="fa fa-list-ul"></i> {:L('ADMIN_AD_INDEX')}</a></li>
								<li><a href="{:U('ad/add')}"><i class="fa fa-plus"></i> {:L('ADMIN_AD_ADD')}</a></li>
							</ul>
						</header>
						<php> $status=array("1"=>L('DISPLAY'),"0"=>L('HIDDEN')); </php>
						<div class="panel-body">
							<section class="panel" >
								<form class="form-horizontal js-ajax-form form-horizontal " role="form" method="post" action="{:U('term/listorders')}">
									<section  class="panel" style="margin-bottom: 0px">
													<div class="btn-group m-bot15">
														<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('ad/toggle',array('display'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
														<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('ad/toggle',array('hide'=>1))}" data-subcheck="true">{:L('HIDE')}</button>
													</div>
									</section>
									<section id="no-more-tables">
											<table class="table table-hover table-bordered table-list">
												<thead>
												<tr>
													<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
													<th >ID</th>
													<th>{:L('NAME')}</th>
													<th>{:L('HOW_TO_USE')}</th>
													<th >{:L('STATUS')}</th>
													<th >{:L('ACTIONS')}</th>
												</tr>
												</thead>
												<tbody>
												<foreach name="ads" item="vo">
													<tr>
														<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.ad_id}"></td>
														<td>{$vo.ad_id}</td>
														<td>{$vo.ad_name}</td>
														<php>$usercode="{".":sp_getad('".$vo['ad_name']."')}";</php>
														<td>{$usercode}</td>
														<td>{$status[$vo['status']]}</td>
														<td>
															<a href="{:U('ad/edit',array('id'=>$vo['ad_id']))}">{:L('EDIT')}</a> |
															<a href="{:U('ad/delete',array('id'=>$vo['ad_id']))}" class="js-ajax-delete">{:L('DELETE')}</a>
														</td>
													</tr>
												</foreach>
												</tbody>
												<tfoot>
												<tr>
													<th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
													<th width="50">ID</th>
													<th>{:L('NAME')}</th>
													<th>{:L('HOW_TO_USE')}</th>
													<th>{:L('STATUS')}</th>
													<th>{:L('ACTIONS')}</th>
												</tr>
												</tfoot>
											</table>
									</section>
									<section class="panel">
												<div class="btn-group m-bot15">
													<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('ad/toggle',array('display'=>1))}" data-subcheck="true">{:L('DISPLAY')}</button>
													<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('ad/toggle',array('hide'=>1))}" data-subcheck="true">{:L('HIDE')}</button>
												</div>
									</section>
								</form>
							</section>
						</div>
					</section>
				</div>
			</div>
		</div>

	</div>
	</div>
	</div>
	<!--body wrapper end-->

	<!--footer section start-->
	<footer>
		<admintpl file="copyright" />
	</footer>
	<!--footer section end-->

	</div>
	<!-- main content end-->
</section>
<script src="__PUBLIC__/TciocEx/js/jquery-1.10.2.min.js"></script>
<script src="__PUBLIC__/js/wind.js"></script>

<script src="__PUBLIC__/TciocEx/js/jquery-ui-1.9.2.custom.min.js"></script>
<script src="__PUBLIC__/simpleboot/bootstrap/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery-migrate-1.2.1.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/bootstrap.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/modernizr.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/jquery.nicescroll.js"></script>
<script src="__PUBLIC__/js/ajaxForm.js"></script>

<script type="text/javascript" src="__PUBLIC__/TciocEx/js/jquery.validate.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-localization/messages_zh.min.js"></script>
<script src="__PUBLIC__/TciocEx/js/scripts.js"></script>
<script src="__PUBLIC__/TciocEx/js/validation-init.js"></script>
<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>